UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BsKO/oL+Iyl2vZ5M3FAxXYAuze0FjLaSlW3xnFMViQI='
WHERE
key_id = '7cc97e7e2850ca4fb0fb59948283bcd8a8864f786a6a9cb3813c7e9a5ca6efec'
AND (
token = 'BsKO/oL+Iyl2vZ5M3FAxXYAuze0FjLaSlW3xnFMViQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)