UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j4hei4iXkvrnUTp35TifYSblmWHfpU2jWe68eXRvfuk=' 
WHERE 
  key_id = 'e80bc5b92de8ed81fb6a32e819296d028fa26ef2d5f8dfb43ed09fda2b16fc0d' 
  AND (
    token = 'j4hei4iXkvrnUTp35TifYSblmWHfpU2jWe68eXRvfuk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053