UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C4fmR/Ft7THl6rXGOZnJ9Ri0Js+IYuxltgmEaPUbrZ0=' 
WHERE 
  key_id = '56256be9d1d53f8b4c9756eaa296fb7df0ab68cffdf43203aaefc84a20188f6a' 
  AND (
    token = 'C4fmR/Ft7THl6rXGOZnJ9Ri0Js+IYuxltgmEaPUbrZ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025