UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5VPC+PaDyCgLTKXUY4KSE5L4KYGUzCtRpydJCWHnzJg='
WHERE
key_id = '172b02ca424ab2f69bac63fc38b5c4db6f3383a72675ba9ba7dd42b7c903edb4'
AND (
token = '5VPC+PaDyCgLTKXUY4KSE5L4KYGUzCtRpydJCWHnzJg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)