UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DZhewzVpGAvIRZHZGR0piK407JRb0vCz0mCoKXesXes='
WHERE
key_id = '83e1f76b342fcefe9c26776a979088ee3637137512dd09028cb1222abb17968e'
AND (
token = 'DZhewzVpGAvIRZHZGR0piK407JRb0vCz0mCoKXesXes='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)