UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8HMDSVNZwlrguDlEQL9+e0jEqZO+z+qzzP6zi8bSGf0='
WHERE
key_id = '86521f74f2f9908ce61bd40b913520cc97099e257b280cd6d9846a2cfca9c4df'
AND (
token = '8HMDSVNZwlrguDlEQL9+e0jEqZO+z+qzzP6zi8bSGf0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)