UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RA9QLEUh6nYpkMeWhOMmwFxuefoYAB8QYNpWfuNVT/w='
WHERE
key_id = '4c63f6612f864b21316a943f11848a5f1c3ef65519b6e43a099176edf107f938'
AND (
token = 'RA9QLEUh6nYpkMeWhOMmwFxuefoYAB8QYNpWfuNVT/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)