UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I6WwYg+1Q7Cq3cMUv5PSpCbLm7no0YXXIpeV83GAcPw='
WHERE
key_id = '3193d648ff16fab48a6966ec2e011ec2a2cb3cc4f48ac0f2d13c2453f78a3e50'
AND (
token = 'I6WwYg+1Q7Cq3cMUv5PSpCbLm7no0YXXIpeV83GAcPw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)