UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Or/8rV7HkgelQ/5wI1OasJVCrumZJVqOWi0mAlW5TMU=' 
WHERE 
  key_id = '76df28c0f49b5246eb403e640b7211f2ba7ad1fa5b0ffebe3c3abdca985b8ad9' 
  AND (
    token = 'Or/8rV7HkgelQ/5wI1OasJVCrumZJVqOWi0mAlW5TMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022