UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6tjwJED0BiMTDDZFyHq7wr9V37eqWt4/Mca7g6HsdM8='
WHERE
key_id = '108628729071cf2633b4c33348717b62f4d516efdd2d4b15d25baeb31cf3ebd6'
AND (
token = '6tjwJED0BiMTDDZFyHq7wr9V37eqWt4/Mca7g6HsdM8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)