UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ilf2BU0YUeVyVgV741BHCyLngp3xYTztC5jPF3eZBiY='
WHERE
key_id = '0809bd55585e20383e5ebf983f27cf32c4fdf8afd79e4989c35fe5a94758d90a'
AND (
token = 'Ilf2BU0YUeVyVgV741BHCyLngp3xYTztC5jPF3eZBiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)