UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UGNdw3+wQ2HWYTi3gxceBS0jviGY3j4csidhDQwSMrw=' 
WHERE 
  key_id = '13c916a0b2f69e607e9d36c2ec470290cf3e1faceb00632f78caf8e0800d85a8' 
  AND (
    token = 'UGNdw3+wQ2HWYTi3gxceBS0jviGY3j4csidhDQwSMrw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020