UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R9YRPd3lIbEavpmJV7BGfvLyHnLtk/x4qnQfdFquaWY='
WHERE
key_id = 'a78a43dd91b9b652561b17081bb9471bc37bfcb66e81b257761ecdb84b1875c4'
AND (
token = 'R9YRPd3lIbEavpmJV7BGfvLyHnLtk/x4qnQfdFquaWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)