UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7/IcBr0NunItrq/4vdfMw4wLZwazvHwIuPWgSZg8As4='
WHERE
key_id = 'f15ddc64e9489ac2369e6d3f316d97aed57aca44867f1925e1c027b4d492ebe5'
AND (
token = '7/IcBr0NunItrq/4vdfMw4wLZwazvHwIuPWgSZg8As4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)