UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HsFtM1z0EDYw7Ur9HZ/9mlNUqhLf6eip7BJcYkj4yhc='
WHERE
key_id = '0ae130eaae19beda209ead514ddd4368198cda15adb2c8d0173afc387e64a94b'
AND (
token = 'HsFtM1z0EDYw7Ur9HZ/9mlNUqhLf6eip7BJcYkj4yhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)