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