UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GsfgKv4ub/pFAONxr46VxgVVOdoBYtf6S93afofjvUQ=' 
WHERE 
  key_id = '9883ebaffc61e2af6d19d713d12df2c24a83c48b25dd9e04dac0a23bb91589dd' 
  AND (
    token = 'GsfgKv4ub/pFAONxr46VxgVVOdoBYtf6S93afofjvUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028