UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tw8I0YzHQjXOjrPF43iQbBGcrAW+fkm7bWg2MTU5AQY='
WHERE
key_id = '2e75e942d9cabe3160728f91e87bbf9fb4874ef0f10de520bad247a7848dc124'
AND (
token = 'tw8I0YzHQjXOjrPF43iQbBGcrAW+fkm7bWg2MTU5AQY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)