UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NC0T/gB8ZYzx3p2I7KKVp0O+dyNYrgdhXlPHhG+ccGc='
WHERE
key_id = '2911eb174f2adee13ac2fbfc8100b1b27b7a9c9f197bb88d77004ff3d964113d'
AND (
token = 'NC0T/gB8ZYzx3p2I7KKVp0O+dyNYrgdhXlPHhG+ccGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)