UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SlJrDzmvZNV0vlWY46exb/V9rl6K1Gex632xnkSqVlU=' 
WHERE 
  key_id = '02f543892f662d7b4c3e6db2ec0392fa2b993ea10189acef9f0c07bf4c6763a2' 
  AND (
    token = 'SlJrDzmvZNV0vlWY46exb/V9rl6K1Gex632xnkSqVlU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030