UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1+ZM0AQBsLxXy4xEuGBVOVYLVwp2ZAw5QsqtO+T9Is4=' 
WHERE 
  key_id = '5331fee2e9d4a3669d19395b5af955e87bca6ae4c7bb3733ff31d8aa214ea5c3' 
  AND (
    token = '1+ZM0AQBsLxXy4xEuGBVOVYLVwp2ZAw5QsqtO+T9Is4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049