UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ywLoQzFLAeLPPsg0wtWQN8nJyMh1MRtP03VPe6bHrE='
WHERE
key_id = '045fed474ab8b7675f9d472e29d3014fec3b6d3aec90dd7f4eac109b56277463'
AND (
token = '9ywLoQzFLAeLPPsg0wtWQN8nJyMh1MRtP03VPe6bHrE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)