UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c6HSDld9OHKB9boWz8u0YJ6/pwZYWYmUjq8LaB6A40Y='
WHERE
key_id = '32a6d07dbc17fe80c341fc25c29ecc0614ea790361dab9b458708cd40a31d599'
AND (
token = 'c6HSDld9OHKB9boWz8u0YJ6/pwZYWYmUjq8LaB6A40Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)