UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WvWlo1sZ7dXfbZ1GP51jom9I3g67Ru9FBnKjvpZLG2U='
WHERE
key_id = '4d45c2f7a19f662261a756b085ef5885f46aa521f0b66852c56d133fd5b8930d'
AND (
token = 'WvWlo1sZ7dXfbZ1GP51jom9I3g67Ru9FBnKjvpZLG2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)