UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9D/5Q+8BezvSYWzCRXjav2zMvL/mY8d4BYjwnwmnv1c='
WHERE
key_id = '559bbedb7977c096fc81382d80961f9f0f31743d1c869a000c0b4066d0195014'
AND (
token = '9D/5Q+8BezvSYWzCRXjav2zMvL/mY8d4BYjwnwmnv1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)