UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uD/MBDLS55IcizlgBFieKJJj0u+Jhdj7aDnY7yMIUAg='
WHERE
key_id = '2f73772a2679615e7efe2b10685bc5c20564b5c071dcefc79811a4f7e0e4711a'
AND (
token = 'uD/MBDLS55IcizlgBFieKJJj0u+Jhdj7aDnY7yMIUAg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)