UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a8gRzFnXF5JakKCEX6P0JhQ7+sImYQIdvymSDWYqlrI='
WHERE
key_id = '8d71a2cababcea7c344180947d1cea67e26de57aa2ab4c26c83d86521bca6259'
AND (
token = 'a8gRzFnXF5JakKCEX6P0JhQ7+sImYQIdvymSDWYqlrI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)