UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RpIPlIUI7rUrsQNvr3/scKv4vV19dBM2a3Cxy71LRbY='
WHERE
key_id = 'd4539008d86f235c922d68b57c456b6d7a4cbfbc44f4ef9d2be18709dc50cdfb'
AND (
token = 'RpIPlIUI7rUrsQNvr3/scKv4vV19dBM2a3Cxy71LRbY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)