UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xv1wjpSjD+BIaSIr25E6zcHnw3iTEcnpXxDLo4lhcpc=' 
WHERE 
  key_id = '280b50c2b66371495a096acdc9d4a9428ecee2bc05eb8e6dc4213e69c003b490' 
  AND (
    token = 'xv1wjpSjD+BIaSIr25E6zcHnw3iTEcnpXxDLo4lhcpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076