UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '23Ik7Mo4kr37D0V0ErGA6hk3zIXSWg7c4K8E7iQES/g='
WHERE
key_id = 'fe6e123f6055144fed27843cb6d8c96cbfed8a18c2f0958a34a4374c0ab1e83b'
AND (
token = '23Ik7Mo4kr37D0V0ErGA6hk3zIXSWg7c4K8E7iQES/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)