UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't0na3agozgmCRV7Zz4Qo2/IVQa+tfJtStZ+DhhQqRNc=' 
WHERE 
  key_id = 'fca200b2c2f97444763b64f70eb9c5b12cb642cd25ac2a78f0e6659c5c6e36eb' 
  AND (
    token = 't0na3agozgmCRV7Zz4Qo2/IVQa+tfJtStZ+DhhQqRNc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026