UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wD7Pdi/PxHNn6w5UnlJbBqw3PU3cpDDUHKmMfNZd+Xs=' 
WHERE 
  key_id = 'eab4b3d81a6be973e50a4acee1e6e9343b89ffcd9671a646f627b48547eaa7ff' 
  AND (
    token = 'wD7Pdi/PxHNn6w5UnlJbBqw3PU3cpDDUHKmMfNZd+Xs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020