UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bCWmXF1p5ALypWib2Y3SJ7zxu4Dd+/R/GCII06rmQZE=' 
WHERE 
  key_id = '3e92bd8430983b27f1dd6b387d51e0b304569e7f26ae501bd96396859d370f11' 
  AND (
    token = 'bCWmXF1p5ALypWib2Y3SJ7zxu4Dd+/R/GCII06rmQZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00129