UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I0MEaksGP0ARpERi1JFKlvuK94FnBC3bJw/3lFovf/k='
WHERE
key_id = '8dc2671c27fa7e7f1e0f6e5c1bee19fdf91c7509bbb232ac902d529b8404c196'
AND (
token = 'I0MEaksGP0ARpERi1JFKlvuK94FnBC3bJw/3lFovf/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)