UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ngsbZaLpRieESYpDb4t0gZH6hQe3TMZXDQ/fZZCHqvM='
WHERE
key_id = '441dbc6d87d4abfe6945f1e50c947d24117381efbc2294db5aad46c1e6d342ac'
AND (
token = 'ngsbZaLpRieESYpDb4t0gZH6hQe3TMZXDQ/fZZCHqvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)