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

Query time 0.00054