UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FMR8S5J3GpMl75PZsWO0SOYtE/OqRzGFjd+5tKiLAX4='
WHERE
key_id = 'bea4663a94b1c888b39a085a31382dad068e3275fcc0335a13d6782adc76afce'
AND (
token = 'FMR8S5J3GpMl75PZsWO0SOYtE/OqRzGFjd+5tKiLAX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)