UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9XznM6MkQDOzvSeT2vgVkyLK+FjA+kVq6mX0q64sAVs='
WHERE
key_id = 'be6de33ea4b73e07080aa983310f34e51ba88c5edf67b578aca37614a2beaab4'
AND (
token = '9XznM6MkQDOzvSeT2vgVkyLK+FjA+kVq6mX0q64sAVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)