UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5NXbECiwKqV5lcEuyie47XVPYaK2k/Bsma3AayM5L/4='
WHERE
key_id = '4dcd44d70860fcbb54d19a3a78e73388da1d6331db1a0cba8d5fdcaf7b01b7c2'
AND (
token = '5NXbECiwKqV5lcEuyie47XVPYaK2k/Bsma3AayM5L/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)