UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'avf3sjMfJC1BoeZzAyG5XUJuf+YHh98eyH7GiPyjH/I='
WHERE
key_id = '4c0f252c477a0dc4e626b6f0c46dcf05db1cfad4edf3b63129f410b431e838f8'
AND (
token = 'avf3sjMfJC1BoeZzAyG5XUJuf+YHh98eyH7GiPyjH/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)