UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FzwrwihBqFIz5nQ9GvhJHEL/TEHaHOnfHupW7JRj8CE='
WHERE
key_id = '6b7db2363e973d518f72c6cc50953dd7a3d6f8c62599585d927aee3a8041419a'
AND (
token = 'FzwrwihBqFIz5nQ9GvhJHEL/TEHaHOnfHupW7JRj8CE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)